<template>
  <div class="hello">
    <img src="../assets/brain.png" style="width: 200px;">
    <h1 style="font-size: 50px;font-weight: bold;">{{ msg }}</h1>
    <form>
      <div style="margin:50px 0;">
        <el-input v-model="my_class" placeholder="班级" style="width:200px"></el-input>
        <el-input v-model="name" placeholder="姓名" style="width:200px"></el-input>
      </div>
      <el-button type="primary" @click="start">开始实验</el-button>
    </form>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome   To   Our   Experiment  !',
      my_class:'',
      name:'',
    }
  },
  methods:{
    start(){
      var time = new Date();
      sessionStorage.setItem("my_class", this.my_class);
      sessionStorage.setItem("name", this.name);
      sessionStorage.setItem("start_time", time);
      this.$router.push({path:'/test'})
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
